<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateComConfigsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('com_configs'))
        {
            Schema::create('com_configs', function (Blueprint $table) {
                $table->string('id', 45)->primary()->comment('ID');
                $table->boolean('is_sys')->comment('是否系统');
                $table->string('key', 45)->comment('key');
                $table->text('value')->nullable()->comment('value');
                $table->integer('sort')->default(0)->nullable()->comment('排序权重');
                $table->timestamps();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('com_configs');
    }
}
